package bat.ke.qq.com.service;

import bat.ke.qq.com.bean.Fox;
import bat.ke.qq.com.bean.User;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.inject.Inject;
import javax.inject.Named;
import java.beans.ConstructorProperties;
import java.util.List;

/**
 * 源码学院-Fox
 * 只为培养BAT程序员而生
 * http://bat.ke.qq.com
 * 往期视频加群:516212256 暗号:6
 */
@Service
public class UserService {

//    @Autowired(required = false)
//    //@Qualifier("user2")
//    private List<User> userList;


    private User user;


    public UserService(){
        System.out.println("调用构造器UserService()");
    }

//    public UserService(String name){
//        System.out.println("调用构造器UserService(String name)");
//    }


    public UserService(User user){
        this.user = user;
        System.out.println("调用构造器UserService(User user)");
    }
//

//    public UserService( Fox fox){
//        System.out.println("调用构造器UserService(Fox fox)");
//    }


//    public UserService(User user, Fox fox){
//        System.out.println("调用构造器UserService(String name, Fox fox)");
//    }


//    public UserService(User user, String name){
//        System.out.println("调用构造器UserService(String name, String name)");
//    }


    @Override
    public String toString() {
        return "UserService{" +
                "user=" + user +
                '}';
    }

    public void setUser(User user) {
        this.user = user;
    }

    public User getUser() {
        return user;
    }
}
